package com.lezheba.db.entity;

import java.io.Serializable;
import java.util.Date;
 
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
 
@Entity
@Table(name="deal")
public class Deal implements Serializable{
 
    private static final long serialVersionUID = -8767337896773261247L;
    
    
    @Id 
    @Column(name="id")    
    @GeneratedValue(strategy=GenerationType.AUTO) 
    private Long id;
    
    @Column(name="website_id")    
    private Long websiteId;
    
    @Column(name="city_name")
    private String cityName;
    
    @Column(name="city_url")
    private String cityUrl;
    
    @Column(name="deal_id")
    private String dealId;
    
    @Column(name="deal_title")
    private String dealTitle;
    
    @Column(name="deal_rank")
    private Long dealRank;
    
    @Column(name="deal_url")
    private String dealUrl;
    
    @Column(name="deal_img")
    private String dealImg;
    
    @Column(name="deal_cate_id")
    private Long dealCateId;
    
    @Column(name="deal_subcate_id")
    private Long dealSubcateId;
    
    @Column(name="deal_desc")
    private String dealDesc;
    
    @Column(name="value")
    private String value;
    
    @Column(name="price")
    private Float price;
    
    @Column(name="rebate")
    private Float rebate;
    
    @Column(name="sales_min")
    private Long sales_min;
    
    @Column(name="sales_num")
    private Long salesNum;
    
    @Column(name="sold_out")
    private String soldOut;
    
    @Column(name="is_post")
    private Boolean isPost;
    
    @Column(name="start_time")
    private Date startTime;
    
    @Column(name="end_time")
    private Long endTime;
    
    @Column(name="coupon_start_time")
    private Long couponStartTime;
    
    
    @Column(name="coupon_end_time")
    private Long couponEndTime;
    
    @Column(name="deal_tips")
    private String dealTips;
    
    @Column(name="deal_wow")
    private String dealWow;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getWebsiteId() {
		return websiteId;
	}

	public void setWebsiteId(Long websiteId) {
		this.websiteId = websiteId;
	}

	public String getCityName() {
		return cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	public String getCityUrl() {
		return cityUrl;
	}

	public void setCityUrl(String cityUrl) {
		this.cityUrl = cityUrl;
	}

	public String getDealId() {
		return dealId;
	}

	public void setDealId(String dealId) {
		this.dealId = dealId;
	}

	public String getDealTitle() {
		return dealTitle;
	}

	public void setDealTitle(String dealTitle) {
		this.dealTitle = dealTitle;
	}

	public Long getDealRank() {
		return dealRank;
	}

	public void setDealRank(Long dealRank) {
		this.dealRank = dealRank;
	}

	public String getDealUrl() {
		return dealUrl;
	}

	public void setDealUrl(String dealUrl) {
		this.dealUrl = dealUrl;
	}

	public String getDealImg() {
		return dealImg;
	}

	public void setDealImg(String dealImg) {
		this.dealImg = dealImg;
	}

	public Long getDealCateId() {
		return dealCateId;
	}

	public void setDealCateId(Long dealCateId) {
		this.dealCateId = dealCateId;
	}

	public Long getDealSubcateId() {
		return dealSubcateId;
	}

	public void setDealSubcateId(Long dealSubcateId) {
		this.dealSubcateId = dealSubcateId;
	}

	public String getDealDesc() {
		return dealDesc;
	}

	public void setDealDesc(String dealDesc) {
		this.dealDesc = dealDesc;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public Float getRebate() {
		return rebate;
	}

	public void setRebate(Float rebate) {
		this.rebate = rebate;
	}

	public Long getSales_min() {
		return sales_min;
	}

	public void setSales_min(Long sales_min) {
		this.sales_min = sales_min;
	}

	

	public Long getSalesNum() {
		return salesNum;
	}

	public void setSalesNum(Long salesNum) {
		this.salesNum = salesNum;
	}

	public String getSoldOut() {
		return soldOut;
	}

	public void setSoldOut(String soldOut) {
		this.soldOut = soldOut;
	}

	public Boolean isPost() {
		return isPost;
	}

	public void setPost(boolean isPost) {
		this.isPost = isPost;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return new Date(endTime*1000);
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime.getTime()/1000;
	}

	public long getCouponStartTime() {
		return couponStartTime;
	}
	
	public Date getCouponStartDate() {
		return new Date(couponStartTime);
	}
	
	public Date getCouponEndDate() {
		return new Date(couponEndTime);
	}

	public void setCouponStartTime(long couponStartTime) {
		this.couponStartTime = couponStartTime;
	}

	public long getCouponEndTime() {
		return couponEndTime;
	}

	public void setCouponEndTime(long couponEndTime) {
		this.couponEndTime = couponEndTime;
	}

	public String getDealTips() {
		return dealTips;
	}

	public void setDealTips(String dealTips) {
		this.dealTips = dealTips;
	}

	public String getDealWow() {
		return dealWow;
	}

	public void setDealWow(String dealWow) {
		this.dealWow = dealWow;
	}
	
	public String toString(){
		StringBuffer sBuffer = new StringBuffer();
		sBuffer.append("{title:").append(this.dealTitle).append("}");
		sBuffer.append(", {img:").append(this.dealImg).append("}");
		sBuffer.append(", {desc:").append(this.dealDesc).append("}");
		sBuffer.append(", {url:").append(this.dealUrl).append("}");
		sBuffer.append(", {tips:").append(this.dealTips).append("}");
		sBuffer.append(", {city:").append(this.cityName).append("}");
		sBuffer.append(", {price:").append(this.price).append("}");
		sBuffer.append(", {salesNum:").append(this.salesNum).append("}");
		sBuffer.append(", {rebate:").append(this.rebate).append("}");
		sBuffer.append(", {endTime:").append(this.endTime).append("}");
		sBuffer.append(", {soldOut:").append(this.soldOut).append("}");
		sBuffer.append(", {dealWow:").append(this.dealWow).append("}");
		sBuffer.append(", {value:").append(this.value).append("}");
		sBuffer.append(", {websiteId:").append(this.websiteId).append("}");

		

		

		

		return sBuffer.toString();
	}
    
    
}
